package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017/11/1.
 */
@Entity
@Table(name = "user_exam_progress", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class UserExamProgressEntity   extends IAcross {
    private int uapId;
    private Integer userId;
    private Integer identity;
    private Integer examId;
    private Timestamp createDate;

    public UserExamProgressEntity()
    {
        super();
    }

    public UserExamProgressEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "uap_id")
    @GeneratedValue
    public int getUapId() {
        return uapId;
    }

    public void setUapId(int uapId) {
        this.uapId = uapId;
    }

    @Basic
    @Column(name = "user_Id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "identity")
    public Integer getIdentity() {
        return identity;
    }

    public void setIdentity(Integer identity) {
        this.identity = identity;
    }

    @Basic
    @Column(name = "exam_id")
    public Integer getExamId() {
        return examId;
    }

    public void setExamId(Integer examId) {
        this.examId = examId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserExamProgressEntity that = (UserExamProgressEntity) o;

        if (uapId != that.uapId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (examId != null ? !examId.equals(that.examId) : that.examId != null) return false;
        if (identity != null ? !identity.equals(that.identity) : that.identity != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uapId;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (identity != null ? identity.hashCode() : 0);
        result = 31 * result + (examId != null ? examId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }
}
